package com.spider.common.bean.html;

import com.spider.common.utils.JsonUtil;
import com.xuxueli.crawler.annotation.PageFieldSelect;
import com.xuxueli.crawler.annotation.PageSelect;
import com.xuxueli.crawler.conf.XxlCrawlerConf;
import lombok.Data;

import java.util.List;

/**
 * @author marver
 * @Description .margT0, .margR0, body > div.article > div.mainWrap > div.leftSide > div > div.fl.cbp3.cbhg > div:nth-child(1) > div:nth-child(5)," +
 *         "body > div.article > div.mainWrap > div.leftSide > div > div.fl.cbp3.cbhg > div:nth-child(1) > div:nth-child(6)
 * @date 2018/12/14 15:34
 */
@PageSelect(cssQuery = ".board")
@Data
public class PageVo {
    @PageFieldSelect(cssQuery = "h2>a")
    private List<String> leftCategory;
    @PageFieldSelect(cssQuery = "span>a,em>a")
    private List<CategoryVo> leftTwoCategory;

    /*@PageFieldSelect(cssQuery = "div.rightSide > div.board > h2 > a",selectType = XxlCrawlerConf.SelectType.TEXT)*/
    private String rightCategory;
    /*@PageFieldSelect(cssQuery = "div>span>a,em>a")*/
    private List<String> rightTwoCategory;


    @Override
    public String toString() {
        return "PageVo{" +
                "leftCategory='" + leftCategory + '\'' +
                "leftTwoCategory='" + JsonUtil.getJsonByObj(leftTwoCategory) + '\'' +
                "rightCategory='" + rightCategory + '\'' +
                "rightTwoCategory='" + JsonUtil.getJsonByObj(rightTwoCategory) + '\'' +
                '}';
    }

}
